Creating Offline Web Applications in Macromedia Central
Table of Contents
Implementing Network Status
Now create the onNetworkStatus function, which will let
your application download and cache files the user requested that were
not available offline.
// Handle network status changes
function onNetworkChange(c) {
/* Check connection; if connected, cache files that are waiting in the queue */
if (c) {
var total = _que.getLength();
for (var i = 0; i < total; i++) {
var u = _que.getItemAt(i).label;
appShell.addToLocalInternetCache(u);
_dp.addItem(u);
}
// Clear the queue
_que.replaceAllItems(null);
}
}